Skip to content

Add support for contingency messaging#9083

Draft
CrisBarreiro wants to merge 9 commits into
feature/cris/clarify-duck-player-entry-pointfrom
feature/cris/enable-contingency-messaging
Draft

Add support for contingency messaging#9083
CrisBarreiro wants to merge 9 commits into
feature/cris/clarify-duck-player-entry-pointfrom
feature/cris/enable-contingency-messaging

Conversation

@CrisBarreiro

@CrisBarreiro CrisBarreiro commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1214489465023873?focus=true
Tech Design URL (if applicable):

Description

Add support for contingency messaging:

  • Bottom sheet when visiting YouTube
  • Message in settings with hidden toggle

Steps to test this PR

Feature 1

  • Fresh install the app
  • Go to YouTube ad blocking settings and enable the feature
  • Go to Feature Flag Inventory and enable adBlockingExtensionFeature -> enableContingencyMode
  • Go to YouTube ad blocking settings and check nothing changed
  • Open a YouTube video (you might see ads), check no contingency messaging is shown
  • Go to Feature Flag Inventory and enable adBlockingExtensionFeature -> adBlockingUXImprovements
  • Go to YouTube ad blocking settings and check the toggle disappeared and there's a contingency message
  • Go back and reload the video
  • Check a contingency message is shown, Dismiss it
  • Navigate to another video
  • Check contingency message not shown again
  • Go to Feature Flag Inventory and disable and immediately enable adBlockingExtensionFeature -> enableContingencyMode
  • Go back and reload the video
  • Check contingency messaging is shown again

UI changes

Before After
Screenshot_20260702_173322 Screenshot_20260702_180254
contingency-after

Note

Medium Risk
Changes user-visible ad blocking settings and YouTube browsing UX under remote flags; injection is already blocked in contingency mode elsewhere, but mis-flagging could hide controls or show messaging unexpectedly.

Overview
Adds contingency mode UX when remote flags adBlockingUXImprovements and enableContingencyMode are on: a one-time bottom sheet on foreground YouTube page loads (via ContingencyMessageHandler from AdBlockingExtensionJsInjectorPlugin.onPageFinished), with persistence in a new DataStore and session guards so repeats are suppressed until contingency is toggled off and back on.

Ad Blocking settings v2 switches from the block-ads toggle to a static contingency info row when contingency is active, and drives the status indicator via isStatusIndicatorOn (off in contingency even if blocking is notionally enabled).

RealDuckPlayer moves the new-install ad-blocking rollout combine() collector from init to MainProcessLifecycleObserver.onCreate, with test updates to trigger lifecycle explicitly.

Reviewed by Cursor Bugbot for commit a655a3a. Bugbot is set up for automated code reviews on this repo. Configure here.

CrisBarreiro commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 52afd00. Configure here.

Show a one-off bottom sheet when ad-blocking contingency mode is enabled
and the user visits YouTube, gated behind the adBlockingUXImprovements
flag. It shows once per contingency-enabled period; the shown state is
reset when contingency mode is disabled (observed via the toggle's
enabled() flow in MainProcessLifecycleObserver.onCreate).

Driven by AdBlockingExtensionJsInjectorPlugin on page load, which notifies
the internal ContingencyMessageHandler, keeping JS injection and UI
concerns separated. No changes to any -api module.
@CrisBarreiro CrisBarreiro changed the base branch from develop to graphite-base/9083 July 2, 2026 16:10
@CrisBarreiro CrisBarreiro force-pushed the feature/cris/enable-contingency-messaging branch from 4f76570 to 540ac9e Compare July 2, 2026 16:10
@CrisBarreiro CrisBarreiro changed the base branch from graphite-base/9083 to feature/cris/clarify-duck-player-entry-point July 2, 2026 16:10
@CrisBarreiro CrisBarreiro mentioned this pull request Jul 2, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants